﻿using System;
using System.Collections.Generic;
using ConfOrm;
using ConfOrm.NH;
using ConfOrm.Shop.Subclassing;
using NHibernate.Mapping.ByCode;

namespace Dexter.Repository.NHibernate.ConfORM {
	public class DiscriminatorValueAsEnumValuePack<TRootEntity, TEnum> : EmptyPatternsAppliersHolder
		where TRootEntity : class
		where TEnum : struct {
		// Methods
		public DiscriminatorValueAsEnumValuePack ( IDomainInspector domainInspector ) {
			base.rootClass = new List<IPatternApplier<Type, IClassAttributesMapper>> {
				new DiscriminatorColumnNameApplier ( domainInspector ), 
				new ClassDiscriminatorValueAsEnumValueApplier<TRootEntity, TEnum> ( domainInspector )
			};
			base.subclass = new List<IPatternApplier<Type, ISubclassAttributesMapper>> {
				new SubclassDiscriminatorValueAsEnumValueApplier<TRootEntity, TEnum> ( )
			};
		}
	}
}